import requests
from lxml import etree

url = 'https://dianying.taobao.com/showList.htm?spm=a1z21.3046609.header.4.55be112a3rxHIp&n_s=new'

headers = {
    'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36',
}
response = requests.get(url, headers=headers)

print(response.status_code)
# print(response.text)

tree = etree.HTML(response.text)
items = tree.xpath('//div[@class="movie-card-wrap"]')
for item in items:

    dic = {
        '电影名':item.xpath('.//div[@class="movie-card-name"]/span[@class="bt-l"]/text()'),
        '详情URL':item.xpath('.//a/@href')[0],
    }
    # print(dic)
    res = requests.get(item.xpath('.//a/@href')[0], headers=headers)
    print(res.status_code)
    print(res.text)

    break